<?php

namespace app\controller;


use app\BaseController;
use app\services\DataService;
use app\services\Factory;
use app\utils\AppRespUtil;

class Api extends BaseController
{
    public function test()
    {
        $userInfo = [
            'chat_no' => 'G2000001',
        ];
        $data = [
            'seller_id' => 25,
            'seller_image' => 'seller-thumb-mage/2023-1/baf99d9657058e4ffb5f37011d95695e.png',
            'seller_name' => '浙江大学校友会旗舰店',
            'order_id' => 162,
            'goods_id' => 220,
            'goods_image' => 'goods-thumb-images/2023-1/89a49966dae30b7dee5bce0235418363.png',
            'goods_name' => 'ZJU-LOGO',
            'order_message' => '已签收',
            'additional_information' => '补充信息'
        ];
        $params = [
            'to_user_id' => 'U200042',
            'message' => $data,
            'message_type' => 'sys_logistics',
            'chat_type' => 'single',
            'created_time' => time()
        ];
        Factory::getChatService($userInfo, $params)->sendPlatformMessage();
        return AppRespUtil::success();
    }

    public function dealData()
    {
        DataService::dealData();
        return AppRespUtil::success();
    }
}